package com.nl.controller.sms5g.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

import com.nl.controller.sms5g.bean.bo.SignExcelData;

/**
 * 创建excel，写入数据，然后下载到本地
 *
 * @author baiyu
 *
 */
public class DownloadExcel {
    /**
     * 初始化数据，将会被存储到excel表格中
     *
     * @return
     * @throws Exception
     */
    public static Map<String, List<String>> getMember(List<SignExcelData> list) {
        Map<String, List<String>> map = new HashMap<String, List<String>>();
        SimpleDateFormat df = new SimpleDateFormat("yyyy.MM.dd");
        for (int i = 0; i < list.size(); i++) {
            ArrayList<String> members = new ArrayList<String>();
            members.add(i+1+ "");
            members.add(df.format(new Date()));
            members.add(list.get(i).getProvinceName() + "");
            members.add(list.get(i).getCityName());
            members.add(list.get(i).getEcName());
            members.add(list.get(i).getServiceNumber());
            members.add(list.get(i).getExtendNumber());
            members.add(list.get(i).getSignName());
            members.add(list.get(i).getSendEcName());
            members.add(list.get(i).getIndustryType());
            members.add(list.get(i).getCustomerType());
            map.put(i+1+ "", members);
        }
        return map;
    }

}

